#ifndef _utilities_h
#define _utilities_h

#include <cstring>

	// Integer to Char Array
	void itoca(const int i, char* array) {
		memcpy(array, &i, sizeof(i));
	}

	// Short to Char Array
	void stoca(const short s, char* array) {
		memcpy(array, &s, sizeof(s));
	}

	// Unsigned Integer to Char Array
        void uitoca(const unsigned int i, char* array) {
                memcpy(array, &i, sizeof(i));
        }

	// Char Array to short
	short catos(const char* array) {
		short s;
		memcpy(&s, array, sizeof(s));
		return s;
	}

	// Char Array to Int
        int catoi(const char* array) {
                int i;
                memcpy(&i, array, sizeof(i));
                return i;
        }

	// Char Array to Unsigned Int
        unsigned int catoui(const char* array) {
                unsigned int i;
                memcpy(&i, array, sizeof(i));
                return i;
        }
#endif
